home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / syscall / Ioc_Truncate.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-19  |  1.2 KB  |  50 lines

  1. /* 
  2.  * Ioc_Truncate.c --
  3.  *
  4.  *    Source code for the Ioc_Truncate library procedure.
  5.  *
  6.  * Copyright 1988 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  */
  15.  
  16. #ifndef lint
  17. static char rcsid[] = "$Header: Ioc_Truncate.c,v 1.1 88/06/19 14:29:26 ouster Exp $ SPRITE (Berkeley)";
  18. #endif not lint
  19.  
  20. #include <sprite.h>
  21. #include <fs.h>
  22.  
  23.  
  24. /*
  25.  *----------------------------------------------------------------------
  26.  *
  27.  * Ioc_Truncate --
  28.  *    Truncate the stream to a specified length.
  29.  *
  30.  * Results:
  31.  *    None.
  32.  *
  33.  * Side effects:
  34.  *    The underlying device or file gets truncated.
  35.  *
  36.  *----------------------------------------------------------------------
  37.  */
  38.  
  39. ReturnStatus
  40. Ioc_Truncate(streamID, length)
  41.     int streamID;
  42.     int length;
  43. {
  44.     register ReturnStatus status;
  45.  
  46.     status = Fs_IOControl(streamID, IOC_TRUNCATE, sizeof(int),
  47.             (Address)&length, 0, (Address)NULL);
  48.     return(status);
  49. }
  50.